package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 口味 持久层
 */
@Mapper
public interface FlavorMapper {

    /**
     * 批量新增菜品对应的口味
     * @param flavors
     */
    void saveBatch(List<DishFlavor> flavors);


    @Delete("delete from dish_flavor where dish_id= #{id}")
    void deleteByDishId(Long id);

    void deleteBatchByDishId(List<Long> ids);

    @Select("select * from dish_flavor where dish_id=#{id}")
    List<DishFlavor> getByDishId(Long id);


}
